import 'dart:typed_data';

import 'package:flutter_test/flutter_test.dart';
import 'package:xf_evaluate/xf_evaluate.dart';
import 'package:xf_evaluate/xf_evaluate_platform_interface.dart';
import 'package:xf_evaluate/xf_evaluate_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockXfEvaluatePlatform
    with MockPlatformInterfaceMixin
    implements XfEvaluatePlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<void> destroyVadListener() {
    // TODO: implement destroyVadListener
    throw UnimplementedError();
  }

  @override
  Future<void> setVadListener() {
    // TODO: implement setVadListener
    throw UnimplementedError();
  }

  @override
  Future<void> detectVad(Uint8List frame, int len) {
    // TODO: implement detectVad
    throw UnimplementedError();
  }

  @override
  Future<void> resetVad() {
    // TODO: implement resetVad
    throw UnimplementedError();
  }

  @override
  void setChannelListener(Function(String method, dynamic p1) callback) {
    // TODO: implement setChannelListener
  }

  @override
  Future<void> asyncVadConfig(String status_bos_timeout, String status_finish) {
    // TODO: implement asyncVadConfig
    throw UnimplementedError();
  }

}

void main() {
  final XfEvaluatePlatform initialPlatform = XfEvaluatePlatform.instance;

  test('$MethodChannelXfEvaluate is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelXfEvaluate>());
  });

  test('getPlatformVersion', () async {
    XfEvaluate xfEvaluatePlugin = XfEvaluate();
    MockXfEvaluatePlatform fakePlatform = MockXfEvaluatePlatform();
    XfEvaluatePlatform.instance = fakePlatform;

    expect(await xfEvaluatePlugin.getPlatformVersion(), '42');
  });
}
